<?php use_stylesheet('home.css') ?>
<?php use_stylesheet('jquery.fancybox-1.3.4.css') ?>

<?php use_javascript('jquery-1.8.2.min.js') ?>
<?php use_javascript('jquery.carouFredSel-6.2.0-packed.js') ?>
<?php use_javascript('helper-plugins/jquery.mousewheel.min.js') ?>
<?php use_javascript('helper-plugins/jquery.touchSwipe.min.js') ?>
<?php use_javascript('helper-plugins/jquery.transit.min.js') ?>
<?php use_javascript('helper-plugins/jquery.ba-throttle-debounce.min.js') ?>
<?php use_javascript('dotimeout.js') ?>
<?php use_javascript('jquery.fancybox-1.3.4.pack.js') ?>


    <section id="sectionWelcome">
        <?php include_component('componente','welcome') ?>
    </section>              


    <section id="bloqueHeader">  <?php include_component('componente','header') ?>    </section>
    <section id="bloqueBaner">      </section>
    <section id="sectionNav"><?php include_component('componente','nav') ?> </section>    
    
    <section id="bloqueBuscador"> <?php include_component('componente','search') ?>    </section>
  
    <section id="sectionBodyHome">
        <div style="padding-top: 18px;">
            <?php echo image_tag('logocarrito.png') ?>
        </div>
        <hr>
        
        <div id="contenedor" style="text-align: left;padding-left: 2%;width: 67%;background-color: #FFF;">
           <?php $lista = $sf_user->getAttribute('s_carrito',null); ?>
            <?php if($lista!=null): ?>
            <?php foreach($lista as $row): ?>
            <div id="detalleProducto">
                <div><a href="javascript:mostarDetalle('<?php echo $row['objeto']->getId(); ?>')"><?php echo image_tag('ejemplo/'.$row['objeto']->getRutaDocumento()) ?></a></div>
                <div>
                    <ul>
                        <li style="width: 625px;"><a href="#"><h2 style="font-size: 1em;margin-bottom: 5px;color:#000000;"><?php echo strtoupper(  $row['objeto']->getTitulo() );  ?></h2></a><h3 style="color: #E20612;margin-bottom: 5px;">&nbsp;&nbsp;<?php  echo $row['objeto']->getAutor(); ?></h3>&nbsp;&nbsp;</li>
                        <li style="margin-bottom: 5px;"><span style="color: #E20612;">&nbsp;&nbsp;En Stock</span></li>
                        <li style="margin: 10px 0px;"><?php echo image_tag('check.png','style=position: relative;top: 6px;') ?>&nbsp;<a style="text-decoration: none;color: #818180;position: relative;top: 8px;" href="javascript:agregarFavorito('<?php echo $row['objeto']->getId(); ?>')">Guardar</a>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo image_tag('eliminar.png','style=position: relative;top: 6px;') ?>&nbsp;<a style="text-decoration: none;color: #818180;position: relative;top: 8px;" href="<?php echo url_for('carrito/eliminarDetalle?idDocumento='.$row['objeto']->getId()) ?>">Eliminar</a></li>
                    </ul>
                </div>
                <div>
                    <span style="color:#E20612;font-size: 1.1em;font-weight: bold;">$ 18.00 &nbsp;<span style="color: #000;padding: 4px;background-color: #ECECEC;">1</span></span>
                </div>
            </div>
            
           <hr style="width: 96%;margin: 15px 0px;">
            <?php endforeach; ?>
          
           <div style="text-align: right;margin-right: 8%;">
               <h4 style="display: inline-block;">SubTotal</h4> &nbsp;&nbsp;<span style="color:#E20612;font-size: 1.1em;font-weight: bold;">$ 18.00 &nbsp;<span style="color: #000;padding: 4px;background-color: #ECECEC;"><?php echo count($lista); ?></span></span>&nbsp;&nbsp;&nbsp;<a style="top: 0px;" href="http://www.visanet.com.pe/visanet_new/home.html" class="botonPago2">Comprar</a>
            </div>
              <?php endif; ?>
        </div>
        
    </section>
    <script type="text/javascript">
    
           function mostarDetalle(id)
           {               
               $.ajax({
                  url:     '<?php echo url_for('@ajaxContentDetalle') ?>',
                  data:    { idDocumento : id },
                  success: function(data)
                  {
                        $.fancybox({
                            'content' : data
                          });
                  }
                 });
           }
           
           function agregarFavorito(id)
           {
               
               $.ajax({
                  url:     '<?php echo url_for('@ajaxAgregarFavorito') ?>',
                  data:    { idDocumento : id },
                  success: function(data)
                  {
                        
                  }
                 });
           }
               
                
                
          
          
              
           
  </script>